home *** CD-ROM | disk | FTP | other *** search
- # =======
- # args.pl
- # =======
- #
- # Illustrate/test argument transfer
- #
- # Bob Denny 10-Feb-95
- #
- # WARNING TO perl PORTERS: NT perl inserts the '\r' on its own.
- # The output of scripts are read in BINARY mode by the server,
- # since the script may produce binary data. Therefore your
- # Unix-flavor perl must be converted to use plain '\n' and
- # not '\r\n' for line endings. SORRY!!!
- #
- # Edits:
- # 25-Feb-95 rbd Fid argc, is #-1 in perl
- #
- $CRLF = "\n";
- $method=$ENV{"REQUEST_METHOD"};
- print "Content-type: text/plain",$CRLF,$CRLF;
- print "CGI/1.2 (NT perl on Win95!, args.pl) report:",$CRLF;
- print " ^^^^^^^^^", $CRLF;
- if($#ARGV eq '-1') {
- print "No command args";
- } else {
- print "ARGC=",($#ARGV+1),", ARGV: ";
- for (@ARGV) { print; print " "; };
- }
- print $CRLF,$CRLF;
- print "Environment variables:",$CRLF;
- print "REQUEST_METHOD: ",$method,$CRLF;
- print "SCRIPT_NAME: ",$ENV{"SCRIPT_NAME"},$CRLF;
- print "QUERY_STRING: ",$ENV{"QUERY_STRING"},$CRLF;
- print "PATH_INFO: ",$ENV{"PATH_INFO"},$CRLF;
- print "PATH_TRANSLATED: ",$ENV{"PATH_TRANSLATED"},$CRLF;
- if($method eq "POST") {
- $cfile= $ENV{"CONTENT_FILE"};
- print "CONTENT_TYPE: ",$ENV{"CONTENT_TYPE"},$CRLF;
- print "CONTENT_FILE: ",$cfile,$CRLF;
- print "CONTENT_LENGTH: ",$ENV{"CONTENT_LENGTH"},$CRLF;
- print "---- begin content ----",$CRLF;
- print while <STDIN>;
- print $CRLF,"----- end content -----",$CRLF;
- }
- print $CRLF,"end of report",$CRLF;
-
-
-
-
-